home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / f90 / pxffork.z / pxffork
Text File  |  1998-10-30  |  7KB  |  159 lines

  1. PXFFORK(3F)                                            Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      PPXXFFFFOORRKK - Creates a process
  6.  
  7. SSYYNNOOPPSSIISS
  8.      SSUUBBRROOUUTTIINNEE PPXXFFFFOORRKK ((_i_p_i_d,, _i_e_r_r_o_r))
  9.      IINNTTEEGGEERR _i_p_i_d,, _i_e_r_r_o_r
  10.  
  11. IIMMPPLLEEMMEENNTTAATTIIOONN
  12.      UNICOS, UNICOS/mk, and IRIX systems
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.      On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
  16.      default when compiling programs with the MIPSpro 7 Fortran 90 compiler
  17.      or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
  18.      7.2 F77 compiler.
  19.  
  20.      The PPXXFFFFOORRKK routine uses the ffoorrkk(2) system call to create a new
  21.      process.  The child process is the same as the parent process except
  22.      for the following:
  23.  
  24.      * The child process has a unique, currently unused process ID.
  25.  
  26.      * The child process has a different parent process ID. The child
  27.        process's process ID is the parent process, or calling process, ID.
  28.  
  29.      * The child process has its own copy of the parent's file descriptors.
  30.        Each of the child's file descriptors shares a common file pointer
  31.        with the corresponding file descriptor of the parent process.
  32.  
  33.      * Process locks are not inherited by the child process (see pplloocckk(2)).
  34.  
  35.      * The uuttiimmee, ssttiimmee, ccuuttiimmee, and ccssttiimmee of the child process are set to
  36.        0.  The time left until an alarm clock signal is reset to 0.
  37.  
  38.      * All sseemmaaddjj values are cleared (see sseemmoopp(2)).
  39.  
  40.      * The parent's set of pending signals are not inherited by the child.
  41.  
  42.      UNICOS and UNICOS/mk systems only:
  43.  
  44.      * Record locks set by the parent process are not inherited by the
  45.        child process (see ffccnnttll(2) and lloocckkff(3C)).
  46.  
  47.      * In a multitasking group, only the process that executed the fork
  48.        system call is copied.
  49.  
  50.      * Each attached shared memory segment is attached and the value of
  51.        sshhmm__nnaattttcchh in the data structure associated with the shared memory
  52.        segment is incremented by 1.
  53.  
  54.      IRIX systems only:
  55.  
  56.      * File locks previously set by the parent are not inherited by the
  57.        child (see ffccnnttll(2)).
  58.  
  59.      * Page locks are not inherited (see mmppiinn(2) on IRIX systems).
  60.  
  61.      * The time left until an _i_t_i_m_e_r signal is reset to 0.
  62.  
  63.      * The child will not inherit the ability to make graphics calls.  The
  64.        child process may receive a segmentation fault upon attempting to
  65.        make a graphics call, unless it initializes itself as a graphics
  66.        process via wwiinnooppeenn(()) or ggiinniitt(()).  Currently, if the parent is a
  67.        graphics process, the child's attempt to become a graphics process
  68.        will fail.
  69.  
  70.      * The share mask is set to 0 (see sspprroocc(2)).
  71.  
  72.      When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
  73.      UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
  74.      kind unless documented otherwise.  On UNICOS and UNICOS/mk, default
  75.      kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
  76.      IRIX, the default kind is KKIINNDD==44.
  77.  
  78.      The following is a list of arguments for this routine:
  79.  
  80.      _i_p_i_d    An output integer variable. _i_p_i_d will be zero for the child
  81.              process and the process ID of the child for the parent
  82.              process.
  83.  
  84.      _i_e_r_r_o_r  An output integer variable that contains zero if PPXXFFFFOORRKK was
  85.              successful or nonzero if PPXXFFFFOORRKK was not successful.
  86.  
  87.      The PPXXFFFFOORRKK routine may return any of the following error values:
  88.  
  89.      EEAAGGAAIINN    If the system-imposed limit on the total number of processes
  90.                under execution in the whole system (NNPPRROOCC) is exceeded or
  91.                if the system-imposed limit on the total number of processes
  92.                under execution by one user (CCHHIILLDD__MMAAXX) is exceeded.
  93.  
  94.      UNICOS and UNICOS/mk systems only:
  95.  
  96.      EEBBUUSSYY     If you attempt to enable accounting when it is already
  97.                enabled, or if you issue a rreessttaarrtt(2) attempt when another
  98.                job or process in the system is using the jid or any pid
  99.                associated with the job (or process) to be restarted.
  100.  
  101.      EEIINNTTRR     If an asynchronous signal (such as interrupt or quit), which
  102.                you have elected to catch, occurred during a fork system
  103.                call.  When execution resumed after processing the signal,
  104.                the interrupted system call returned this error condition.
  105.  
  106.      EEMMEEMMLLIIMM   If more memory space was requested than is allowed for the
  107.                processes attached to this lnode. The maximum value is set
  108.                by the --cc option of the sshhrraaddmmiinn(8) command.  This error
  109.                appears only on systems running the fair-share scheduler.
  110.  
  111.      EENNOOEEXXEECC   If a request was made to execute a file that, although it
  112.                has the appropriate permissions, does not start with a valid
  113.                magic number (see aa..oouutt(5)).
  114.  
  115.      EENNOOMMEEMM    If during an eexxeecc(2) or ssbbrreeaakk(2) system call, a program
  116.                requested more space than the system could supply.  This is
  117.                not a temporary condition; the maximum space specification
  118.                is a system parameter.
  119.  
  120.      EEPPRROOCCLLIIMM  If more processes were requested than are allowed for this
  121.                lnode.  The maximum value is set by the --pp option of the
  122.                sshhrraaddmmiinn(8) command. This error appears only on systems
  123.                running the fair-share scheduler.
  124.  
  125.      IRIX systems only:
  126.  
  127.      EEAAGGAAIINN    If the amount of system memory required is temorarily
  128.                unavailable.
  129.  
  130.      EENNOOSSPPCC    If the caller is a member of a share group and the total
  131.                number of share group members plus child processes exceeds
  132.                the maximum number of users specified by the uussccoonnffiigg(3P)
  133.                command (8 by default).  Any changes made with uussccoonnffiigg (3P)
  134.                must be done Ibeforethe first sproc is formed.
  135.  
  136.      EENNOOLLCCKK    There are not enough file locks in the system.
  137.  
  138. EEXXAAMMPPLLEESS
  139.           program pxftest
  140.           integer ipid, ierror
  141.  
  142.           CALL PXFFORK(ipid, ierror)
  143.           if (ipid .eq. 0) then
  144.              print *,'child'
  145.           else
  146.              print *,'parent'
  147.           endif
  148.           end
  149.  
  150. SSEEEE AALLSSOO
  151.      eexxeecc(2), ffccnnttll(2), ffoorrkk(2), pplloocckk((22)),, rreessttaarrtt(2), sseemmoopp(2), sspprroocc(2),
  152.      ssssbbrreeaakk(2)
  153.      sshhrraaddmmiinn(8)
  154.  
  155.  
  156.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-
  157.      2165, for the printed version of this man page.
  158.  
  159.